/**
 * Created in 2012-3-2.
 */
package com.surekam.mnai.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.surekam.mnai.util.LoggerUtil;

/**
 * 地址信息管理服务类。
 * 
 * @author 吴政
 * 
 */
public class AddressManageServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	private static Logger log = LoggerFactory
			.getLogger(AddressManageServlet.class);

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) {
		methodInvokeLog("doGet(request=" + request + ",response=" + response
				+ ")");

		jumpToAddressMainPage(request, response);
	}

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) {
		methodInvokeLog("doPost(request=" + request + ",response=" + response
				+ ")");

		jumpToAddressMainPage(request, response);
	}

	/**
	 * 跳转到号码管理首页。
	 * 
	 * @param request
	 * @param response
	 */
	private void jumpToAddressMainPage(HttpServletRequest request,
			HttpServletResponse response) {
		methodInvokeLog("jumpToMobileMainPage(request=" + request
				+ ",response=" + response + ")");

		try {
			request.getRequestDispatcher("/address/addressMain.jsp").forward(
					request, response);
		} catch (ServletException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 方法调用日志。
	 * 
	 * @param methodDesc
	 *            方法描述
	 */
	private void methodInvokeLog(String methodDesc) {
		LoggerUtil.methodInvokeLog(log, getClass(), methodDesc);
	}

}
